/*
appcommon.js  1.0
specific functions for the GSF application content windows
*/

var y=null;
var z=null;
var _a={Error:1,_b,_c;
var _d={NW:1,_e,_f,_g,_h,_i,_j,_k,_l;
var _m={iframe:1,_n,_o,_p;
var _q={ok:1,_r,_s,_t;
var _u={pbContentPage:1,_v;
debug=function(a){top.edNLog.debug(a,"debug");};
contentElem=function(b){
return top.frames['ifMainContent']._gE(b);
}
contentReload=function(){
top._gE('ifMainContent').src=top._gE('ifMainContent').src;
}
contentPostBack=function(c,d){
top.frames['ifMainContent'].__doPostBack(c,d);
}
contentRedirect=function(f){
top._gE('ifMainContent').src=f;
}
function setFocus(g,h){
top.setFocus(g,h);
}
function elemStatus(j,k){
_gE(j).disabled=k;
}
function SetDialogTitle(){
top.SetDialogTitle();
}
function ShowError(l,m,n){
top.ShowError(l,m,n);
}
function elemReadOnly(j,k){
top.elemReadOnly(j,k);
}
function setCBByText(o,p){
var _w=xGetElementById(o);
for(var i=0;i<_w.options.length;i++){
if(_w.options[i].text==p){_w.selectedIndex=i;}
}
}
function setCBByValue(o,p){
var _w=xGetElementById(o);
for(var i=0;i<_w.options.length;i++){
if(_w.options[i].value==p){_w.selectedIndex=i;}
}
}
function RefreshWarp(q){
ig_getWebControlById(q).refresh();
}
function warpPnl_RefreshRequest(r,s,t){
if(typeof top["hideError"]=='function'){top.hideError();}
if(typeof Local_RefreshRequest=='function'){Local_RefreshRequest(r,s,t);}
}
function warpPnl_RefreshComplete(u){
if(typeof top.SessionRefresh=='function'){top.SessionRefresh();}
if(typeof Local_RefreshComplete=='function'){Local_RefreshComplete(u);}
}
function warpPnl_InitializePanel(u){
var pi=u.getProgressIndicator();
ig_shared.getCBManager()._timeLimit=300000;
pi.setImageUrl("/images/hourglass.gif");
pi.setLocation(ig_Location.AboveCenter);
if(typeof Local_InitializePanel=='function'){Local_InitializePanel(u);}
}
function doClick(v,e)
{
var _x;
if(window.x){_x=window.x.keyCode;}
else{_x=e.which;}
if(_x==13||_x==9)
{var _y=xGetElementById(v);
if(_y!=null){_y.click();}
e.stopPropagation&&e.stopPropagation();
e.preventDefault&&e.preventDefault();
e.cancelBubble=true;
e.returnValue=false;
e.keyCode=0;
}
}
function initializeCollapsible(w){
var i,_z,_aa=xGetElementsByClassName('collapsible',document,'h2');
for(i=0;i<_aa.length;i++){
_z=document.createElement('div');
_z.collapsibleSection=xNextSib(_aa[i]);
_z.onclick=iconOnClick;
_z.onclick();
if(w!=true){
if(i>0)_z.onclick();
}
_z.onmouseover=iconOnMouseover;
_z.onmouseout=iconOnMouseout;
_aa[i].appendChild(_z);
}
}
function iconOnClick(){
var _ab=this.collapsibleSection;
if(_ab.style.display!='block'){
_ab.style.display='block';
this.className='CollapseIcon';
this.title='Click to collapse';
}
else{
_ab.style.display='none';
this.className='ExpandIcon';
this.title='Click to expand';
}
}
function iconOnMouseover(){
this.collapsibleSection.style.backgroundColor='#999999';
}
function iconOnMouseout(){
this.collapsibleSection.style.backgroundColor='transparent';
}
function iFrameKeyboardEvent(e)
{
var _x;
if(document.all)_x=x.keyCode;
else _x=e.which;
switch(_x){
case 113:
try{top.OpenSearchDialog(top.SearchPage);}
catch(ex){alert("No Search Defined for screen");}
x.keyCode=0;
break;
case 114:
top.swapPanel('dhtmlScanPanel');
x.keyCode=0;
break;
case 118:
top.swapPanel('dhtmlScanPanel');
x.keyCode=0;
break;
case 119:
try{top.OpenSourceDialog(location);}
catch(ex1){alert("No Source found for screen: "+location.pathname);}
x.keyCode=0;
break;
default:
return true;
}
return false;
}
function fixEvent(x){
x.preventDefault=fixEvent.preventDefault;
x.stopPropagation=fixEvent.stopPropagation;
return x;
}
fixEvent.preventDefault=function(){
this.returnValue=false;
};
fixEvent.stopPropagation=function(){
this.cancelBubble=true;
};
if(is.ff){
HTMLElement.prototype.click=function(){
var evt=document.createEvent('MouseEvents');
evt.initMouseEvent('click',true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null);
this.dispatchEvent(evt);
};
}
function stdOnUnload(){}
function stdOnload(){
if(document.title!='Session Timeout Warning'){
var _ac;
if(document.forms[0]){document.forms[0].disabled=false;}
var _ad=document.getElementsByName('MESTitle');
if(_ad.length>0){_ac=_ad[0].content;_ad=null;}
if(_ac!="false"&&top.g_jsTitle){
top.document.title=top.g_jsTitle.innerText=document.title;
}
else if(_ac=="false"&&top.g_jsTitle){
SetDialogTitle();
}
if(typeof top["CloseAllErrors"]=='function'){top.CloseAllErrors();}
if(y!=null){y.focus();}
if(typeof top["SessionRefresh"]=='function'){top.SessionRefresh();}
if(typeof window["LocalOnLoad"]=='function'){document[LocalOnLoad()];}
}
}
edAddEvent(window,'load',stdOnload);
edAddEvent(window,'unload',stdOnUnload);
shortcut.add("esc",top.closeModalDialog);
